from dataaccess import SongData
from common import SearchFilter, SongEntity

def search():
    return resp 

def listen():
    return dict(message=T('hello listener'))

def recently_played(number):
    """returns last number of the songs recently played"""
    return dict()

def songs(album_id):
    """table of the songs for a given album"""
    resp = dict()
    sf = SearchFilter.SimpleFilter(SongEntity.SongEntity.ColumnNames.albumID,
                    SearchFilter.ConditionType.Equal,album_id)
    songs =  SongData.SongData().SelectSongByFilter(sf)

    resp["songs"] = songs
    resp["album_id"] = album_id
    return resp 
    
